﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using Model;

namespace BLL
{
   public class SOP_ProductKeyBLL
    {
        #region 私有变量
       private static SOP_ProductKeyDAL _dal;
       private static SOP_ProductKeyDAL dal
        {
            get
            {
                if (_dal == null)
                {
                    _dal = new SOP_ProductKeyDAL();
                }
                return _dal;
            }
        }
        #endregion
       /// <summary>
        /// 添加
        /// </summary>
        /// <param name="ProductKey"></param>
        /// <returns>5成功，-5失败，-10000系统错误</returns>
       public static int AddProductKey(ProductKey Ent)
       {
           return dal.AddProductKey(Ent);
       }
        /// <summary>
        /// 开户审核
        /// </summary>
        /// <param name="CheckerID"></param>
        /// <param name="CheckPwd"></param>
        /// <param name="ID"></param>
        /// <param name="Status"></param>
        /// <param name="Reason"></param>
        /// <returns></returns>
       public static int SetBrandCompanyOpenAccountBillCheck(int billID, ProductKey Ent)
       {
           return dal.SetBrandCompanyOpenAccountBillCheck(billID,Ent);
       }
       public static int CheckAppApplyByID(string BossID)
       {
           return dal.CheckAppApplyByID(BossID);
       }
       #region 通过UserId查询
       public static IList<SOP_ProductKey> GetProductKeyByUserId(int UserId)
       {
           return dal.GetProductKeyByUserId(UserId);
       }
       #endregion

       #region 根据bossid获取SOP_ProductKey的ID
       /// <summary>
       /// 根据bossid获取SOP_ProductKey的ID
       /// </summary>
       ///<param name="bossid"></param>
       /// <returns></returns>
       public static int GetSOP_ProductKeyID(string bossid)
       {
           return dal.GetSOP_ProductKeyID(bossid);
       }
       #endregion

       #region 根据bossid获取SOP_ProductKey的ID和BrandName,CompanyName
       /// <summary>
       /// 根据bossid获取SOP_ProductKey的ID和BrandName,CompanyName
       /// </summary>
       ///<param name="bossid"></param>
       /// <returns></returns>
       public static int GetSOP_ProductKeyName(string bossid, out string brandname, out string companyname)
       {
           return dal.GetSOP_ProductKeyName(bossid, out brandname, out companyname);
       }
       #endregion
    }
}
